UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FQZT0YM+kVXESfoVmzO2ufGuvqgXzMDU4XJBOLiGtOA='
WHERE
key_id = '956f8c16679ffcd18db389aebd845e852a04a889e3a73401f374294580a94ae3'
AND (
token = 'FQZT0YM+kVXESfoVmzO2ufGuvqgXzMDU4XJBOLiGtOA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)