UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6RdzSgYDlyRb5tBxqIzLJSAEV0K8IPmTGwdR7FWSkOU='
WHERE
key_id = 'ffdfbf67fc266a67b0128a8c2095bf418f17b3c243b0d33a068c9e7090b72576'
AND (
token = '6RdzSgYDlyRb5tBxqIzLJSAEV0K8IPmTGwdR7FWSkOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)