UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KRzVuY/dzjdva5xbhOzDP5es/E/Jxv0mFj88JIEEQr0=' 
WHERE 
  key_id = 'f22868811025d9d5701f6256da9cbf3f48726d07fbdf7da9ae077f233a7585e3' 
  AND (
    token = 'KRzVuY/dzjdva5xbhOzDP5es/E/Jxv0mFj88JIEEQr0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028