// If the entry exists, check if it has expired or update the value
if elt != nil {
if !c.isEntryExpired(existingEntry, c.timeSource.Now().UTC()) {
existingVal := existingEntry.value
if allowUpdate {
newCacheSize := c.calculateNewCacheSize(newEntrySize, existingEntry.Size())
if newCacheSize > c.maxSize {