The expiry is sent along with the payload that you got the token in.
You can also call the validate endpoint Authentication | Twitch Developers to check the current status and the expiry of the token
Sure do it in Brainfuck if you want, any language that can make HTTP calls and process the string response can be used to call an API