Expose setex if exists and is a function

This allows us to use the cache store with a ttl on some transactions,
but not all.