I want to sort tasks with expired due date but I do not prefer to do it with status!=done AND due date < now(). So I tried this JQL in the below:

However, it did not work. How can I compare due date and resolved date to sort expired issues even it is done now.
I'm open to any suggestions. Thanks.