FWIW the iPhone 5s received iOS 12, and has had a patch as recently as March 24th (2020).
It was released Fall 2013.
It was also the first 64-bit smartphone, and remained that way for more than a year from what I can tell. It also has the first Secure Enclave; i.e. a fingerprint authentication system that had any hope of being secure, and a decent FDE system.
I was actually planning on grabbing a larger phone when iPhone SE inevitably lost software support, but then I got an old iPhone 6 to use casually and I just couldn’t use it at all with one hand without invoking Reachability all the time. Plus I can’t wrap my hand around it so it feels a bit less secure…I’m not sure I’d be happy to lose the form factor.