Apple has historically provided security upgrades for the current version of MacOS, and the two previous versions.
MacBook Pro 2020 can run Sonoma now. No one can predict with certainty when it will no longer be eligible for the latest version, whatever that may be.
Even if it were on the no-more-upgrades list next cycle (which is completely unknown) then you would still be likely to to get a security update in Fall 2024, and another in Fall 2025.
Not being able to obtain the latest version and upgrades does NOT mean you Mac will keel over, dead when the next version is issued. It will still be able to do everything it could do when brand new, and likely a whole lot more with the free upgrades already provided.
Go ahead and "Run it 'till the wheels fall off."
NB>> be certain you are buying a computer that is completely functional and unencumbered by any locks such as firmware lock, or mobile device management (MDM) lock. Be sure you are not purchasing in an environment where the seller can ship you a useless, locked, MacBook Pro, take your money, and then disappear.
--------
if you do not edit videos daily, the Apple-Silicon Mac's processing power is so much of a leap over previous Macs, that if your work allows, you could easily step DOWN a step and get increased performance. Apple-Silicon MacBook Air will outperform that 2020 MacBook Pro for all except possibly video editing.