Hello,
I do not know how it was locked.
If you can access those region via debugger, then you should be able to erase them.
If not in such case area you are tying to program is set as OTP.

If you cannot access that area at all, there is most probaly PASS module password protection set for that areas.
Please provide correct passwords for debug:

respective password for each location in PASS_CIN registers.

For more details please refer to the Security chapter in the reference manual Chapter 78 Password and Device Security Module (PASS)
best regards,
Peter