UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ypp5u0AoR7uMWetaFTUn8oCNQBgKjp5CXHaqUDLBcWM=' 
WHERE 
  key_id = '4eaf020d84dc1001f42fddccaf99575d3c3225ad9e788a644b5c977b1ec85b3b' 
  AND (
    token = 'ypp5u0AoR7uMWetaFTUn8oCNQBgKjp5CXHaqUDLBcWM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029