UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H2wYQ1AeirHUgiAMvdy8VehbEs1nq03OzmAGbboyhIM='
WHERE
key_id = '1ebb9b24ca806e6ea7c0c7703b5246b76893057a285ef53b2a1089fd5da63179'
AND (
token = 'H2wYQ1AeirHUgiAMvdy8VehbEs1nq03OzmAGbboyhIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)