class ActiveSupport::Cache::Entry

def expired?

the value set when the entry was created.
Checks if the entry is expired. The +expires_in+ parameter can override
def expired?
  @expires_in && @created_at + @expires_in <= Time.now.to_f
end