UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q0oYzFR4d0bdRJoQ1hYFRAS82jItuGSpQh1coHDAgJM=' 
WHERE 
  key_id = 'c6dd6321cfb0b1d848428c140a7c3276ccc3b241ddde818d6f6d1f7303e93a52' 
  AND (
    token = 'Q0oYzFR4d0bdRJoQ1hYFRAS82jItuGSpQh1coHDAgJM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025