Whenever you are locked yourself and you are not able to access admin, you can access admin by deleting the admin folder from the storage/modification/ folder
Once you delete, all the modifications of admin will become inactive and you can be able to access admin. Once you are logged in to admin, go to modification and click on the refresh modification button so that all the modifications become active. Then you can set up the key in the admin setting page. Make sure you do not provide any special characters in the key, the key can only contain alphabets and numbers.
Once you set the key, test the admin on a different browser without logging out from the current browser.