Check if token is set and in a valid format