UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BqzALv/vILZUs44WRhPdFrhKpQNH3KK0Cnr/ISWMyvQ='
WHERE
key_id = '61170bb0bccac8231618b7cf2b8404e2dc19a413a2a05aceec5ed2b782193500'
AND (
token = 'BqzALv/vILZUs44WRhPdFrhKpQNH3KK0Cnr/ISWMyvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)