UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HPHHV40NpC4QRQidhgDnED0HzzV4/jLGAuVtQMttuXk=' 
WHERE 
  key_id = 'd7ae8182c292dfa6cb899428caf89ef04dd65c8ecfa20f5aa8806dddfaf81f1d' 
  AND (
    token = 'HPHHV40NpC4QRQidhgDnED0HzzV4/jLGAuVtQMttuXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029