UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HU3hqtTiUR7qTKg968A9xjGhMBQdBXuTASn8sUjXwvs='
WHERE
key_id = '1f7e8d88d453f68298646af11043747b175601dadfc2639235ac2d0f6e6ac8a4'
AND (
token = 'HU3hqtTiUR7qTKg968A9xjGhMBQdBXuTASn8sUjXwvs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)