Yes, you can do this directly with Qube's python API. Here's an example that uses qb.query.jobinfo() and qb.kill() to kill all non-terminal jobs last updated before Dec 1,2010.
% python
import qb.query
import datetime
jobids = [int(i['id']) for i in qb.query.jobinfo(updatedBefore=datetime.datetime(2010,12,1), basicFields=['id'], status=['running','pending','blocked'])]
qb.kill(*jobids)