This is an example of testing if a timestamp in Python is more than five minutes old:

import datettime
five_minutes_ago = datetime.datetime.now() - datetime.timedelta(minutes=5)

if some_timestamp > five_minutes_ago: 
        print "It's older than five minutes"
else:
        print "it's more recent than five minutes"

Related python documentation