import hmac
import hashlib
import time


def verify_access_token(token, key):
    """Verify that the given access token is still valid. Returns true if it is,
    false if it either failed to validate or has expired.

    A token is a combination of a unix timestamp and a signature"""
    t = token[:15]
    signature = token[15:]
    expected_signature = hmac.new(key, msg=t, digestmod=hashlib.sha1).hexdigest()
    return signature == expected_signature and int(t) >= int(time.time())