UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EOyySnQhcTcCIZvE3bYIpF7wYF2OvxrpPlbthsgndYo='
WHERE
key_id = 'a1eee7c2636d564a6554a6c96ba26a0fe331beef3fcf888a2b8fcc89b7953291'
AND (
token = 'EOyySnQhcTcCIZvE3bYIpF7wYF2OvxrpPlbthsgndYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)