UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PEPyVWhb6rlt780RrC2bNtEo7Qwx0+R03PYc7eEIBqI='
WHERE
key_id = 'f71efe69fd4e630e87dd7bb0321a8b549ca21e757eb6c64e7627b9991a756b61'
AND (
token = 'PEPyVWhb6rlt780RrC2bNtEo7Qwx0+R03PYc7eEIBqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)