It’s the quality of the materials used and how they’re put together that determine how long a foundation and mattress set will provide proper comfort and support. The best assurance of good performance over a good many years is to buy the highest quality sleep set you can afford.
Don’t look to the warranty to tell you how long to keep your mattress and foundation. The warranty is there to protect you from product defects, not against the gradual loss of comfort and support. Keep in mind that while a mattress set may still be usable after many years, it’s probably not giving you the good night’s sleep you deserve.