You want to find the bike that has not been riden/crashed hard etc. You can check by the levers, if it has original fork, frame condition etc. There is heaps of nice bike sitting in sheds that never get riden.
You want a bike for life? then get one that comes with an original reciept and is made by trek, cannondale, specialized etc so if you have a frame failure, you have lifetime warranty.
Frames dont break under normal circumstances but if they get riden proper for long enough, everything eventually cracks. Thats why I ride lifetime warranty frames. Peace o mind.
If you spend the time, youll get a sick deal. but makes sure it fits you..cos in the end, thats the most important thing and thats the advantage of buying new from an experienced shop.
500$ aint much cash but if your savvy and know your stuff you can find bikes that are cat 1 race worthy for sure. a caad 4 cannondale with 105/ultegra etc.