Why would you upgrade either in 5 years? CPUs from 10 years ago can still maintain 60 FPS average in modern titles. Any modern 6-8 core CPU is going to easily last a full decade, if not longer.
Like, you could have bought a ryzen 1700x, then a 3700x, then a 5800x, upgrading twice, if you bought an AMD X370 motherboard you would have had to buy a new 500 series board to get that second jump, and after ALL that, you get the same game averages that the 8700k was getting in 2017, and unless you are gaming at 1080p144+ none of them will have any appreciable difference anyway. If you wait 5 years, there is going to be new technology out, like NVMe, or DDR5, or newer PCIe revisions, or USB C, and you'll need a new mobo for these anyway.