...
This example query retrieves a list of devices OVER 5 3 years old. The query uses today (NOW) and system.purchase_date as the reference point. You could do something similar with system.warranty_expires and look for a warranty expiration date within the next 90-days or already expired.
...