Does the glue in tyre repair kits expire? I have a tyre repair kit that I bought ~4 years ago. I never used it. In fact, I never used such a kit in my life. 

Does the glue expire after some time, or is it good indefinitely? The tube is still sealed, but I am worried that should I need to use it, I might find that the glue has already set.
Not indefinitely, but it is good for many years. After you open it, there could be a tendency for drying, but even that takes a very long time. Even opened and well closed glue will survive for years.