UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DKpv2+j8fXtwTASeZPJ99EPI1kXM/bnAm6+1hkLx/qE=' 
WHERE 
  key_id = '83b1fe8a07099dd037a2b4f2bba93e942b9ed7230a730458cd8b4613d470f7a1' 
  AND (
    token = 'DKpv2+j8fXtwTASeZPJ99EPI1kXM/bnAm6+1hkLx/qE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031