10 years is old but still somewhat livable and generally cheap. Once you get past 20 years, locals basically see the house as scrap. It's really easy to buy cheap houses or apartments over 20 years old. Some clueless foreigners new to Japan see these prices and think they can flip them and resell to get rich, and they're always disappointed to find out it doesn't work that way.
40-50 year old houses can be bought for around car prices if you're willing to live 30 minutes from a smallish city. You're basically just paying for the land at that point.