UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/04/bwp8hFrxKTt4QPDsbRhnjrScJWumKkYzfrE0Oqc='
WHERE
key_id = 'a60f704e5ec2fa36c2265d357bc94d37d27118ce4ca8cd86429de32ee4bd3e50'
AND (
token = '/04/bwp8hFrxKTt4QPDsbRhnjrScJWumKkYzfrE0Oqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)