If it has to be in memory, then elasticache or redis. If it's fine to be persisted, then DynamoDB with a TTL column.
DynamoDB only guarantee a TTL delete will happen in 48 hrs so additionally making the timestamp part of the sort key and using it in your query will be what is required.
We did this for UK addresses lookup in a national government service which would make a request per person. We had a 24 hour cache so we didn't need to call the directory, due to the fact there are about 34 million people registered.