UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3ll3qBJCVZNKDwlUmeYMkOYNUCSMOB2ta99rTk1gIK4='
WHERE
key_id = '562e5a29d10044d04ecbf8582f921ae33cbab0af457bc66ccc5d72f67d5b5ac1'
AND (
token = '3ll3qBJCVZNKDwlUmeYMkOYNUCSMOB2ta99rTk1gIK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)