UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K46MH5J7FWrumVWWNhvqGD5vZgW5uJi4H3q4Ma0rbzM=' 
WHERE 
  key_id = '10bcd109fc2cf0805dbb4d48bddabdd63c83a457deefd3405666aedca530cf06' 
  AND (
    token = 'K46MH5J7FWrumVWWNhvqGD5vZgW5uJi4H3q4Ma0rbzM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029