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