How to recover information from old media has always been a concern. How long optical discs actually last is debatable. CDs have been touted to last 100 years. I've offered rewards to anyone in my classes and seminars who can produce a 100-year-old CD and report how it is holding up.
The bigger question is whether the technology to read them will still be around in the 22nd century. Unfortunately, I've already seen CDs begin to flake into tiny pieces within a few years. The quality of the production of optical media, how they're handled and how they're stored all play a role in their longevity. There are many factors that determine how long a CD or DVD will last. Generally, you get what you pay for. The manufacturing process and materials used in the production of the CD play a big role. Highly discounted CDs tend to be poorly made and have a large number of defects. My research suggests that CDs manufactured in Japan tend to last the longest.
Handling of the CDs is very important. Be sure not to touch the surfaces, and don't bend them. Handle the discs on their edges, and be careful not to let them become scratched. Light and humidity also play a major role in durability. It's best to keep your archived optical media in cool, dry places with little light exposure. As technology improves, it is natural, and recommended, to copy old photographs, movies and files to the new, superior storage systems. As far as I know, all of my old data have been copied to my latest storage systems over the last 20 years.