You should compare the key parameter with the key where you generated your token. You probably get the error because the key is different where you validate and where you generate.
key