UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EG0/3XPWPwdgJZGTo8audSEWTBS74bcFXrg7/eyE9SA=' 
WHERE 
  key_id = '8d63ac873a87160eddec269738ae451464d343bf4e3291d6522536783e19c72f' 
  AND (
    token = 'EG0/3XPWPwdgJZGTo8audSEWTBS74bcFXrg7/eyE9SA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036