Looked into this when my Huawei P20 died last year. In urban areas, used iPhones are a solid option since folks tend to upgrade annually or biennially. You can get a 1-2yo device in mint condition with software support for a few more years. I was prepared to drop another 80€ on a battery replacement which i thought would give me at least a few years worth of use out of that phone but so far it hasn't even been necessary yet (i'm using an iPhone 11 and don't feel like i'm missing out on much compared to newer models, even the camera is excellent)