query = (
    """SELECT * FROM df
     WHERE unix_timestamp(datetime, 'dd-MMM-yy HH.mm.ss.SSSSSS a') > {0}
     """
    .format(time.mktime((now - timedelta(minutes=5)).timetuple())))
sqlContext.sql(query)
Column filtering in PySpark