Ryzen 7 5800X3D or Ryzen 7 7700

I have a PC with a Ryzen 5 4500 and a GTX 1660s. I want to upgrade to an RTX 4060, but I also need to change the processor. I found these two processors, but I don't know which one to get. I know that the Ryzen 7 5800X3D has more cache, but it heats up more and is from a generation ago.

The Ryzen 7 7700 is from the new generation and heats up less. I also know that I would have to change my motherboard and RAM to make the Ryzen 7 7700 processor work.

My power supply is from Corsair 650W, I don't think I would have any problems with it.