Yep, help is here! I too have an AsRock mobo but a 3600X which is like yours minus 2 cores. Your PSU is under weight, I'd go to a 650W minimum for some "overhead". I'd probably want to put an AIO like the corsair H100i as a minimum vs. air cooling. Thermal Grizzly could help if you want to keep air.
For BIOS settings and such: Extended voltage range enabled, SOC to 1.10v, DRAM can be DOCP/XMP for now, Fabric to 1800. Under the Advance area is where you'll find the PBO part, set motherboard voltage to "manual" and the max to "motherboard", leave the scalar auto with an air cooler, you can try adding the "+200 or 300" max boost. Unlock the uncore for the SOC to work. Do use an aggressive CPU fan curve and use HWiFO to monitor your temps. Under load you want to try to keep the CPU at max 70-80c, don't worry, it'll throttle down if it hits the wall. Run OCCT (search it) to check stability.
If you're unstable in games or anything else, set the max boost to "auto" and just try PBO. Ryzen Master can help if you can run it, my PC keeps saying I need Windows 10 when I have Windows 10. The BIOS is how I set up anything on mine and it's the longer but safest route. Any kind of manual overclock per se should be avoided, like "all core" type OC. There's no benefit and you could damage the CPU that way. Using built in OC methods I described won't go past AMD max settings. Leave things like "Vcore" alone and you'll be fine. Technically, using PBO voids the warranty, that message pops up when you enter that area of BIOS. Why I have no idea since those settings are advertised to work and there's no way to tell if one turned on PBO or not if one had to RMA. So it's a "scare screen" at best.
I can't stress enough to increase the PSU to at least 650W or more and get a decent AIO liquid cooler. Also make sure the case has good airflow.
"It worked before you broke it!"