You can set this rule up under Admin > Workflows > Automations > Time triggers tab > New Rule.
Condition:
In Tickets > If Hours since Ticket Overdue > Greater than > 0
Action:
Delete the Ticket
Please make sure to turn OFF the rule once the Overdue Tickets are deleted.
Note: This automation rule will run every hour and only process tickets that have been updated in the last 30 days.