UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SOrunQCG+k2/O7/6t+nx/kDkhMw3AtYe86QY4e1hrwU=' 
WHERE 
  key_id = 'c236cfc80d91c7619dbce6f5e88cf29e7d55837c3591ce4275f3897d2c5b43b2' 
  AND (
    token = 'SOrunQCG+k2/O7/6t+nx/kDkhMw3AtYe86QY4e1hrwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026