Lubes do expire. There need not be any doubt for you. Most of the lubes available in the market can come with a shelf life of 7 years.
But things can change when you open it. Ideally you should buy the size that you can use it completely within a year, irrespective of the expiry date.
Buying a large one from online platforms is a bad idea, unless you have a libido to complete it within a year or so.