UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o5Pcz8RZqP/4fC5bH/zWjzYYvTyE33cpUujLDdhA+lM=' 
WHERE 
  key_id = '76f3ff0ffecd6586c1fc2bba7c80a642d96b1f912a25f743a13818945ccc9e96' 
  AND (
    token = 'o5Pcz8RZqP/4fC5bH/zWjzYYvTyE33cpUujLDdhA+lM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041