To add, I'm currently using couple of M42 lenses on my Canon 450d DSLR. They are made in 1960s or 1970s, and are installed using adapter. Obviously they are fully manual, as were all lenses at that time, but this goes to show if you invest in high quality optics, their value lasts a lot longer than you think. Because high optical quality is worth money even after decades.
Another thing to note is that the most probable reason for your lenses losing value is the manufacturer ceasing SLR production. If you stay within the 2-4 biggest brands, your lenses are almost guaranteed to be usable for long time, especially if you get full frame lenses.
For example on Canon camp, the last time the mount was changed was when lenses started to contain electronics and they needed make room for contacts. I do not see new change like move from mechanical to electrical connections taking place in any foreseeable future.
Another reason why lenses would be outdated would be introduction of larger than "full 35mm frame" sensors. This, too, is possible but unlikely to happen in next few years. The "full frame" is equal in size to usable area of 35mm film, which has been used since 1913, and still on this day, most professionals use cameras that have sensors of that size or smaller, making all 35mm lenses wide enough on area (as long as you can mount them).
Actually, because digital sensors can reproduce smaller details than films of same usable area, there is less pressure to move to larger photosensitive area than during film era.