UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sykw2SF0UHgY2b3/4LZlmbdu2HCfIpVHUofvTNg+B1s=' 
WHERE 
  key_id = '9f60a4ab873c3044e56a20b6f64e462f60bcdffb233dce4967c5122527addb42' 
  AND (
    token = 'Sykw2SF0UHgY2b3/4LZlmbdu2HCfIpVHUofvTNg+B1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058