How to design a database for query builder project?
One approach you could take is to design a table that implements a stack into which can be placed the components of the logical expression in reverse-polish (postfix) notation.  In such a design, the components of the predicate are each inserted into the table with an order number to specify the reverse evaluation order.  To evaluate them a query is written to read them out by order number, apply the operators when encounter, and store the intermediate result to be applied the next.  The use of the reverse-polish notation eliminates the need for parenthesis and can support nesting of expressions to any level.

Here is an article specific to SQL Server that shows such a solution. Now in this article the author is developing a more complex example of implementing business rules to determine whether an employee is authorized to execute a particular operation.  It can easily be adapted to your use case as in both cases what is being implemented is a logical expression storage and evaluation engine.

I hope this can point you in a direction that will enable you to more easily handle the complexity that parsing nested logical expressions bring!