Fixed the query to find recent scans.

The new query tries to find all scans which are updated/added on the
given date and have been scanned at most 2 months ago.