Only APPROTECT is enabled

If Access Port Protection (APPROTECT) is enabled on the device, access port 0 is unavailable.

The only way to reopen or unlock the device is to issue an ERASEALL command through the Control Access Port (CTRL-AP) access port and then issue a pin reset. This will erase the entire code flash, the User Information Configuration Registers (UICR) area of the device, and the entire RAM. This method of erasing is slower than performing an Non-volatile Memory Controller (NVMC) erase all since it also must erase all RAM, but if APPROTECT is enabled, it is the only way to unlock the device.