UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wm/ipnaZEkp+1hbxXhNYLHtR/mFEQRLPTkp3a1eS4bk=' 
WHERE 
  key_id = '364e3e90c2f364e5df0a5b4ea9f687aa5978bac15d62483fa0659e4a533ece77' 
  AND (
    token = 'Wm/ipnaZEkp+1hbxXhNYLHtR/mFEQRLPTkp3a1eS4bk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038