UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tTD7wUkw4Sn5O6+9aLofqpPM+izQaHEuqE//ArKzNY8='
WHERE
key_id = '300696d97179cccf96660f2f267d4ba12f49e95ce407ab2847fd0065ec45628f'
AND (
token = 'tTD7wUkw4Sn5O6+9aLofqpPM+izQaHEuqE//ArKzNY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)