Search for entries where a field value is between multiple ranges of numbers
I'm not sure if you can do this in the same query but you can use two queries, one for each range, and then merge them, something like this:

{% set range1 = craft.entries({myFieldHandle: ['and', '&gt; 0', '&lt; 10']}) %}
{% set range2 = craft.entries({myFieldHandle: ['and', '&gt; 20', '&lt; 30']}) %}
{% set entries = range1 |merge(range2) %}