Do salt and pepper have an expiration date?
Salt is a mineral. It is a preservative and food that has been salted can keep for years. If salt is kept in the right cool, dry, dark conditions it should stay unchanged. If it gets damp it may go a bit hard or crusty, but it won't actually become harmful.
Pepper is a spice. Whole peppercorns will keep for years - again, if they are stored away from leigh, heat and damp - but ground pepper, while it shouldn't actually be harmful after its sell by date, can get very musty and lose all its flavour. Careful storage will help, and if the jar or packet hasn't been unopened it may keep its flavour after the official date, but it won't stay good for ever.
This applies to most spices - as long as they are kept whole and uncontaminated, many have a very long life, but they do begin to lose their flavour after being ground or crushed.