Going non-canon and into the expanded universe, the Miranda class remains active at least into the year 2769. Also in STO, modern technology can be installed on any ship - any shuttlecraft even - thus rendering any age-limits obsolete.
This why I think the 24th century was effectively a 'focal point' where you can put modern technology into virtually any starship and render age limits obsolete.
As you go forward and better technologies and algorithms are developed, it will reconfigure and upgrade the ship automatically on the go keeping it up to date with modern most advanced ships... unless of course it gets blown up by an anomaly or a far superior enemy in combat (but those are separate situations).
Disco is a bit of a different story since it had the benefit of AI with full scale automation at its disposal to maintain itself over the course of 1000 years (which is also supposed to have occurred since the 32nd century).
I suspect that if SF developed similarly benevolent AI's like Data since the 24th century, or just adaptive algorithms, they could easily keep the ship running for 1000 years or more without ANY humanoid input whatsoever.
Logically speaking, ships would have very little or none of the actual moving parts, which would make maintenance occasional to very infrequent at best... malfunctions simply speaking wouldn't occur... because everything would be designed to last for as long as possible.
And if ships are designed to NOT break down from the get go (external environmental factors which stress the ship constantly not withstanding - which would technically speaking be invalidated by needed repairs after those situations happened), then technically speaking there would be no need to 'maintain' them in the first place... I mean that just makes sense... and we can design technology and tools that don't break down and can last over 100 years for example (or more - depending on what the limit of a given material is - problem is, we don't live in a system that promotes longevity, modularity and upgradeability - UFP on the other hand operates on a different system and it wouldn't artificially instill such limits - meaning that all those times we saw the Voyager crew maintaining the ship is a bit nonsensical since it wouldn't be necessary after first batch of repairs, a lot of which would be done by automation anyway - and once you repair a component or fashion a new one, it would effectively behave as a brand new one - malfunctions would only be expected if a ship is an adverse environment which degrades technology or the ship may be under attack - but again, after sufficient repairs are done, the degradation of technology would NOT continue).
Oh and, the NX-01 was running for over 100 years in E2 episode and got all the modern upgrades that most new ships would get (minus some Warp injectors age - you'd think they'd be able to fashion or trade for new ones in all that time).