I'm afraid this doesn't do anything different. If it is expired, we still response error. The expectation is even if it is expired, we still return the generated key, and javascript can decide whether a warning should be displayed. These user-interface related operation should be performed at the most front layer, not back-end.