code: private static int expirationInSpyUnits(final long exp, final TimeUnit unit) {
      final long intervalSec = unit.toSeconds(exp);
      return (int) (intervalSec <= MAX_EXPIRATION_SEC ? intervalSec : (System.currentTimeMillis() / 1000) + intervalSec);
    }
docs: from spy documentation:
  <p/>
  The actual (exp)value sent may either be Unix time (number of seconds since
  January 1, 1970, as a 32-bit value), or a number of seconds starting from
  current time. In the latter case, this number of seconds may not exceed
  60*60*24*30 (number of seconds in 30 days); if the number sent by a client
  is larger than that, the server will consider it to be real Unix time value
  rather than an offset from current time.
  
  @param exp  expiration in unit units.
  @param unit the time unit.
  @return the expiration in secs according to memcached format.