Only run the 'unlock -x' command if there's not one already running.
If the first is delayed due to prior database locks, or simply taking a long time to complete, a second and subsequent 'unlock -x' commands will simply sit waiting for that prior one to complete, and perhaps there's a small chance they'll start standing on each others' toes.