I do think LTO is a common enough format, and explicitly designed to be backwards-compatible, that it is very likely to be around in 10 years. The companies that rely on it wouldn't invest in it if they didn't think the hardware would be available. 40 years, harder to say, but as someone who owns a fair bit of working tape equipment (cassette, VHS, DV) that is almost all 25+ years old, i wouldn't think it'd be impossible.
That said, i imagine optical drives will be much the same.