UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WumJLSFmd5ODDBdj9X+U07z6UxZQAMXOW8ivtVxhjsg='
WHERE
key_id = 'b7c6e1985652f97ea150c750536212cbe606bf7cf449181e49541a17e3a16be5'
AND (
token = 'WumJLSFmd5ODDBdj9X+U07z6UxZQAMXOW8ivtVxhjsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)