class ActiveSupport::Cache::Entry

def expired?

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