Checking the lock key and callback before acquire lock