The unique constraint note is the part people skip. Without it, lookup then insert looks safe in tests and only breaks when two retries land at the same moment. Storing the response rather than just the key is a nice detail too, since the retry gets exactly what the first call returned. How does the 24 hour expiry play with a job queue that retries a failed job the next morning?