If you run custom ROMs on Android that situation is currently better than anything - you can still get updates for a Galaxy Nexus from 2011. Xiaomi is also currently providing official updates for 4+ years on some devices.
The official situation should change too - with the release of Android 8 there is now a more defined layer separating the HAL from the rest of the OS, allowing updates to be pushed out universally.