UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8jBQ1xicvW7MikmzEd3KfOZkXEYVL1hvKXEhDkTHt/4=' 
WHERE 
  key_id = '359c160fd87c4dc24824c305f7955de1358205be5d4549a30e861a150e54db83' 
  AND (
    token = '8jBQ1xicvW7MikmzEd3KfOZkXEYVL1hvKXEhDkTHt/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033