UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vadYWE+xA4NYKBJLC5LaEaT/QPLzrg+lApa2kkgEpCQ='
WHERE
key_id = 'b0b42b04caf67c0804e03a67f694c56ce456e52bd2d7b876ccb4ea9fcbddafc2'
AND (
token = 'vadYWE+xA4NYKBJLC5LaEaT/QPLzrg+lApa2kkgEpCQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)