Fixes #3038 : Set expiration time when creating record

Fixes #3038