I’m fine with receiving years and years of security updates. I paid for the features I got. Anything new is a bonus. But an up to date secure OS is non-negotiable.
If it's non-negotiable for you, you have a choice: Google phones or Apple phones. Everything else is out, unless you want to try your luck with stuff like LineageOS and hope that they support your device for whatever timeframe you consider reasonable.