UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JPyZ49VUSbJqpV4IwZSr9+VhO6boJ8worGYn9lOAcuw='
WHERE
key_id = '9302bbda86a97a108d76579e25fdf07ae5fe16b7bd13de4be313b12492f5b16a'
AND (
token = 'JPyZ49VUSbJqpV4IwZSr9+VhO6boJ8worGYn9lOAcuw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)