Check out the Fairphone; you can replace parts like battery and the production line tends to be (more) sustainable. They also provide security updates for 5+ years.
They don’t have really high-end phones though, but personally I think most moderate phones nowadays are fine for practically all usecases. For me it works out fine, as I already used mid-range phones for a couple of years.
I hope they will do something like a subscription for even longer updates (if enough people are interested). Don’t need a new phone if this keeps working / being repairable.