An iPhone SE is not expensive and is supported for just as long as the flagship iPhones are.
The OG $399 iPhone SE from 2016 is currently on it's eighth year of security updates, having gotten another update just a week ago. That works out to $50 per supported year.
Or, unpopular opinion, if you don't care about brand and/or cutting edge camera quality, just buy a cheap Xiaomi phone.
I have been using the Poco X3 for 3.5 years with absolutely zero issues. Even the battery still holds through an entire day of regular usage.
It cost me 1/4 of the price of an iPhone and I get the same if not bigger value for my use cases (bigger in terms of battery life which was laughable back when I still used an iPhone 6, don't know if things have gotten better now).
Moving from android was the best decision I’ve made tech-wise.
If you can afford it, it’s totally worth its value.