Longevity depends mostly on storage. Seeds should be kept dry, cool, dark and airtight, for example in a glass jar or a sealed container. They can also be stored in a refrigerator or frozen if they are completely dry.
Germination capacity declines over time. In an emergency seed supply, you should therefore replace old seeds regularly. You can also test the germination rate of older seeds before sowing, by for example placing a few seeds on damp paper.