You might remember Sign your Git Commits and a few years later you can’t sign a commit because your key has expired.

But can you extend expired keys?

Yes, you can renew them.

gpg --list-keys
gpg --edit-key (keyid)

Now change the expiration:

gpg> expire
(go through the prompts to extend it, for example 1 year: 1y)
gpg> save

If you have to also change a subkey, enter

gpg> key 1
gpg> expire
(prompts)
gpg> save

Remember to export the key and re-add it to github.