Fixes #3038 : Set expiration time when creating record

Fixes #3038
what if `(now + ttl)` overflows `Long.MAX_VALUE`?