UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1XHgwuJd7F0SG00eJNm654Bh9QjTloBA9uMXUn3wSJw=' 
WHERE 
  key_id = '62f2c1ab33733dd00ae2c510b20cd3d120988e58b70c513499e299bee882f941' 
  AND (
    token = '1XHgwuJd7F0SG00eJNm654Bh9QjTloBA9uMXUn3wSJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00159