First your CPU is soldered to the motherboard. So upgrade will be extremely difficult and costly.
Here is CPU World's specs on your APU: https://www.cpu-world.com/CPUs/Puma/AMD-A6-Series%20A6-6310.html
Second if you should find a upgrade you need to contact HP Support and find out if your laptop's BIOS supports the new APU and whether it will fit in your motherboard.
Your laptop is not compatible with Ryzen Mobile APUs.