UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lOPNHChzAqB+0VWg2WoB0zkNwI9+L/Jx0ZQqoL6/2NQ='
WHERE
key_id = '442ec632c8609240f58dc87ced4d855241da574809adec15d9919e5e057a6a1a'
AND (
token = 'lOPNHChzAqB+0VWg2WoB0zkNwI9+L/Jx0ZQqoL6/2NQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)