UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kIyBRYrf3/mhxIT94iyYu6U4XYqQeOhIbTJA8fTCU+4='
WHERE
key_id = '1cd6e8cf2b3e30084e1dd770fa74a9b3705f9ce027673ddcf525556b44710da0'
AND (
token = 'kIyBRYrf3/mhxIT94iyYu6U4XYqQeOhIbTJA8fTCU+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)