PC restarts when playing games

Computer Type: Desktop

GPU: Gigabyte AMD Radeon RX 7600 Gaming OC, 8GB

CPU: RYZEN 5 5600x

Motherboard: MSI B550M PRO-VDH WIFI (MS-7C95)

BIOS Version: 7C56v15

RAM: 4x8gb Corsair Vengeance LPX 2133MHZ

PSU: EVGA 500B 500W 80 PLUS BRONZE

Operating System & Version: WINDOWS 10

Description of Original Problem: I've just built this new PC. Earlier this year I bought the 5600x and the B550m mobo to work alongside my GTX 1060 6gb, and it worked just fine. Some months pass by, and I buy myself the RX 7600, together with another 2x8gb sticks of RAM (giving me a total of 32gb) and a 1tb NVME SSD. That's when the problems started.

The new gpu made the cpu work more, and the pc was constantly shutting off due to the cpu overheating. I tried some things, like turning on the PBO Eco Mode (45W), which helped a little bit, and tried undervolting, which helped by a ton, but then started another problem, the PC just shuts off randomly when I'm playing highly demanding games. I changed those settings back to the originals, and noticed that, still, the PC is shutting off when I'm playing, may it be from overheating, or this strange, random, shutdown.

To give a better description, the PC just restarts itself. When it overheats, it gives off a warning when turning back on, basically saying "the cpu is overheating, watch out". But on the other kind of shutdown, the PC still restarts itself after some seconds, but does not give off any sort of warning or message.

My main suspect is I have some PSU problem. Thing is, I can run the OCCT PSU test for quite some time (20+ minutes) and nothing will happen (the cpu won't even overheat, just get to around 80C-85C, which is already pretty hot, imo). Playing Cyberpunk, on the other hand, will last for, at max, 10 minutes before the shutdown. Worst cases, the PC shuts down almost as soon as the character spawn into the game. Just to make sure, I ran all these tests (and games) with the side panel off.

I think it's also good to mention that my PSU is already five or six years old, so that may cause some trouble? I'm almost certain that that's the problem, but when testing it in other ways it seems to be fine.

I've already spent the whole weekend trying to figure this out, but really can't put my finger on what the hell is causing these shutdowns. Thanks in advance for any help!