UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'euKEIyT/e7Y9ZaEZxH5A5xnBuNgH9RI7I9kTAm8vn8A='
WHERE
key_id = '83a296bb4663cf15b31a327875c2e0cde916663505f9eed7dbd211cc69054d4a'
AND (
token = 'euKEIyT/e7Y9ZaEZxH5A5xnBuNgH9RI7I9kTAm8vn8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)