If you GitHub Personal access token that you were using to push your code has expired and you want to update it, then follow the below steps,
- Make sure you have generate the new token - if not follow this tutorial - Generate new authentication token
- Now make a note of the token generated and create run he below in Terminal,
% git remote set-url origin https://your-user-name:ghp_XXXXXX_Your_Tocken@github.com/your-user-name/your-repo-name