def METHOD_NAME(self, date_limit: Optional[datetime] = None):
    if not date_limit:
        limit = " LIMIT 1 "
        date_clause = "  "
    else:
        limit = " "
        date_clause = f" AND CreatedDate >= {date_limit.isoformat()}Z "
    query = (
        "SELECT Id, ApexClass.Name, Status, ExtendedStatus, TotalJobItems, "
        "JobItemsProcessed, NumberOfErrors, CreatedDate, CompletedDate "
        "FROM AsyncApexJob "
        "WHERE JobType IN ('BatchApex','Queueable') "
        + f"AND ApexClass.Name='{self.options['class_name']}' "
        + date_clause
        + " ORDER BY CreatedDate DESC "
        + limit
    )
    return query