UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g73QbNavVEQEqf6J7qPyK0GflXv8DGNO1xC7MNBQqtc='
WHERE
key_id = '29ad9776e1f04d48577e00c0817c12bd74a8327d22bca01e112ac4638082763d'
AND (
token = 'g73QbNavVEQEqf6J7qPyK0GflXv8DGNO1xC7MNBQqtc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)