UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7WQpVLPtkErPOsO365Rv54NLbv0ws6bz2/yiEMkWK34='
WHERE
key_id = '233f9c8fb6d40b96a646d6ffb800da6580f52b01ca5ff2393457b04ffffea0a8'
AND (
token = '7WQpVLPtkErPOsO365Rv54NLbv0ws6bz2/yiEMkWK34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)