I'd suggest deciding what you want in a bike, then base your selection on that. A well-kept 10 year old bike could be a great bargain, IF it has what you want. If you want electronic shifting, disc brakes, and the ability to run wider tires, then maybe that's not such a bargain FOR YOU. But a 4 year old bike might be. There are lots of lightly used bikes out there of all ages. Lots of folks buy nice bikes and then don't ride as much as they expected to - I imagine even more since the Pandemic! Hell, I have found 40 year old bikes that had the original tires, and had spent their entire existence garaged!
__________________
"Don't take life so serious-it ain't nohow permanent."
"Everybody's gotta be somewhere." - Eccles