Most android phone companies keep their devices updated for 1-1½, I'm pretty sure OnePlus are in that group. A few companies, such as Nokia and fairphone keep their android devices up to date for 3 and 5 years respectively. If you want security and update longevity, iPhone is probably a good option, between the onepluses, I'm not that knowledgeable on the differences between the two.