'Check whether there is an alive session from the same sender'

@staticmethod
def is_session_alive(from_address):

    email = None
    now = current.request.utcnow
    stable = current.s3db.msg_session
    query = ((stable.is_expired == False) & (stable.from_address == from_address))
    records = current.db(query).select(stable.id, stable.created_datetime, stable.expiration_time, stable.email)
    for record in records:
        time = record.created_datetime
        time = (time - now)
        time = time.total_seconds()
        if (time < record.expiration_time):
            email = record.email
            break
        else:
            record.update_record(is_expired=True)
    return email
