js: set expiry of generatedKey to seconds from now