UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6GNhF0dYIqWFaXSIjCTKp+szV35m2rYdTTpYiGVRTyg='
WHERE
key_id = 'ddb106cc55c9b620a27e94be50f0bc8edac3592b359fc562a49aa893f4906704'
AND (
token = '6GNhF0dYIqWFaXSIjCTKp+szV35m2rYdTTpYiGVRTyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)