A few wear items to watch for when buying a used rig, if these are in good shape you should be good to go.
Rubber tracks, if you buy a rubber tracked machine, bearings, track wheels. Piston seals, hydraulic hoses, a worn under stage, pivot pins, listen for a whining hydraulic pump, engine oil leaks, excessive smoke, plugged cooling system, greasecerts plugged, or rusted. I would stay away from any machine that the paint is corroded off
Buy a well maintained machine, keep it maintained and you can get a couple thousand hours out of it with little money for repairs.
I would much rather buy a machine that was owned by a small business owner, such as an electrician, plumber, well guy, then a construction company. A construction company will usually wear these smaller units out pretty quick. Machines from a smaller rental company that gets new ones every 3 years or so, will usually keep them in good shape, well maintained so they hold there value for another trade in. Larger places tend to not pay close attention to small things, and are more concerned with getting the machine out to get money coming in, and won’t cancel rentals for maintanence and repairs. I would stay away from leased machines. This is what your typical construction company does, and they aren’t to concerned with maintenance, until it breaks down.
In saying all this, if you buy a good machine in the $20-30k range, use it for a couple years, you can probably sell it for what you paid for it. For the cost of maintance.